import request from '@/utils/request'

// 获取-文章分类
export const getCateListApi = () => request.get('/my/cate/list')

// 增加-文章分类
export const addCateApi = (data) => request.post('/my/cate/add', data)

// 更新-文章分类
export const updateCateInfoApi = (data) => request.put('/my/cate/info', data)

// 删除-文章分类
export const delCateApi = (id) =>
  request.delete('/my/cate/del', {
    params: {
      id
    }
  })

// 获取-文章列表
export const getArticleListApi = (params) =>
  request.get('/my/article/list', { params })

// 发布-文章
export const addArticleApi = (data) => request.post('/my/article/add', data)

// 获取-文章详情
export const getArticleDetailApi = (id) =>
  request.get('/my/article/info', { params: { id } })

export const updateArticleApi = (data) => request.put('/my/article/info', data)

// 删除-文章
export const deleteArticleApi = (id) =>
  request.delete('/my/article/info', { params: { id } })
